home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import urllib
- import rb
- from xml.dom import minidom
-
- class LyricWikiParser(object):
-
- def __init__(self, artist, title):
- self.artist = artist
- self.title = title
-
-
- def search(self, callback, *data):
- artist = urllib.quote(self.artist.replace(' ', '_'))
- title = urllib.quote(self.title.replace(' ', '_'))
- htstring = 'http://lyricwiki.org/api.php?artist=%s&song=%s&fmt=text' % (artist, title)
- loader = rb.Loader()
- loader.get_url(htstring, self.got_lyrics, callback, *data)
-
-
- def got_lyrics(self, result, callback, *data):
- if result is None or result == 'Not found':
- callback(None, *data)
- return None
- result += '\n\nLyrics provided by lyricwiki.org'
- callback(result, *data)
-
-
-